Linux 安装 MATLAB

您所在的位置:网站首页 matlab iso Linux 安装 MATLAB

Linux 安装 MATLAB

2024-07-03 18:50| 来源: 网络整理| 查看: 265

MATLAB 是美国的 The MathWorks 公司出品的商业数学软件。其可用于数据可视化、数据分析、数值计算、算法开发(如计算机视觉中的目标跟踪)等。从 2006 年开始,发行编号以年份来命名,每年推出两个版本,上半年(3 月份)标识为 a 版,下半年(9 月份)标识为 b 版,如发行编号 R2017a 表示 2017 年上半年推出的 MATLAB 软件,其对应的版本号是 MATLAB 9.2。本篇介绍如何在 Linux 系统(以 Ubuntu 为例)上安装 MATLAB,发行编号 R2017a. 所有命令以普通用户运行,但部分代码需要用户有 sudo 权限。

软件下载

因为 MATLAB 是商业软件,所以使用其需要进行许可证购买,永久购买大概是 15500 元人民币,或者 6200元人民币/年。本篇介绍的软件是破解版,如果能力允许建议购买正版软件。

破解版软件下载地址:MATLAB_R2017a_Linux

百度网盘提取码是:6ygs

下载后,我们需要使用到如下几个文件:

1234567tree /home/jinzhongxu/MATLAB_R2017a_Linux/home/jinzhongxu/MATLAB_R2017a_Linux├── libmwservices.so├── license_standalone.lic├── R2017a_glnxa64_dvd1.iso├── R2017a_glnxa64_dvd2.iso└── readme.txt 安装软件 创建挂载点

因为 iso 文件在 Ubuntu 上需要我们先挂载才能打开,因此先创建一个目录作为挂载点

1mkdir -p /home/jinzhongxu/matlab 挂载 iso 文件 1

把第一个 iso 文件挂载到挂载点

123cd /home/jinzhongxu/MATLAB_R2017a_Linuxsudo mount -o loop R2017a_glnxa64_dvd1.iso /home/jinzhongxu/matlab# mount: /home/jinzhongxu/matlab: WARNING: device write-protected, mounted read-only.

如果挂载不上,可把 iso 文件的权限放开,方法如下:

1chmod 777 /home/jinzhongxu/MATLAB_R2017a_Linux/*.iso 安装

挂载好后,进入 /home/jinzhongxu/matlab 目录,可以看到类似如下文件

123ls /home/jinzhongxu/matlab# activate.ini bin help installer_input.txt java patents.txt sys ui# archives etc install install_guide.pdf license_agreement.txt readme.txt trademarks.txt version.txt

一切正常,则可进行软件安装,注意安装时不要在 /home/jinzhongxu/matlab/ 目录下直接运行 install,这样行不通,建议使用如下方法:

1sudo /home/jinzhongxu/matlab/install

此时,就会出现熟悉的 MATLAB 安装界面。

选择 Use a File Installation Key —> 选择下一步 —> 选择 I have the File Installation Key for my license —> 输入密钥(在 readme.txt 中的 standalone)09806-07443-53955-64350-21751-41297 —> 选择下一步 —> 安装目录建议默认 /usr/local/MATLAB/R2017a —> 建议全选所有产品 —> 选择下一步进行继续安装

当安装到 75% 时,需要更换 iso 2

挂载 iso 文件 2

挂载 iso 2 前需要先卸载 iso 1,方法如下

1sudo umount /home/jinzhongxu/matlab

然后挂载 iso 2

123cd /home/jinzhongxu/MATLAB_R2017a_Linuxsudo mount -o loop R2017a_glnxa64_dvd2.iso /home/jinzhongxu/matlab# mount: /home/jinzhongxu/matlab: WARNING: device write-protected, mounted read-only.

挂载好后,查看挂载点下的文件,大概如下:

12ls /home/jinzhongxu/matlab# archives

如果一切正常,则可以点击 ok 继续安装。直接完成安装为止。

当安装完成后,挂载 iso 2 即可

1sudo umount /home/jinzhongxu/matlab 激活软件

首先需要在安装目录创建如下目录

1sudo mkdir -p /usr/local/MATLAB/R2017a/bin/licenses

然后把下面的两个文件拷贝到指定目录

12sudo cp license_standalone.lic /usr/local/MATLAB/R2017a/bin/licensessudo cp libmwservices.so /usr/local/MATLAB/R2017a/bin/glnxa64

最后启动MATLAB

1sudo /usr/local/MATLAB/R2017a/bin/matlab

第一次启动需要配置。选择 Activate manually without the Internet —> 选择 Enter the full path to your license file, including the file name: 选择 /home/jinzhongxu/MATLAB_R2017a_Linux 里面的 license_standalone.lic 文件 —> 选择下一步完成激活。

激活后再次启动MATLAB,即可正常使用。

配置MATLAB

在上面所有步骤都完成后,可以通过命令 sudo /usr/local/MATLAB/R2017a/bin/matlab 启动 MATLAB,但是,总感觉命令有些长,而且需要在命令行输入。

如何缩短命令?

首先,把 MATLAB 的安装目录配置到环境变量

123echo 'export MATLAB_HOME=/usr/local/MATLAB/R2017a' >> ~/.bashrcecho 'export PATH=$MATLAB_HOME/bin:$PATH' >> ~/.bashrcsource ~/.bashrc

把 MATLAB 的所有者和所属组更改为普通用户

12sudo chown -R jinzhongxu:jinzhongxu /usr/local/MATLABsudo chown -R jinzhongxu:jinzhongxu /home/jinzhongxu/.matlab

此时,在命令行通过如下命令即可打开 MATLAB

1matlab

如何通过点击图标打开 MATLAB

1sudo vim /usr/share/applications/matlab.desktop

添加如下内容

123456789[Desktop Entry]Type=ApplicationName=MATLABGenericName=MATLAB2017aComment=MATLAB2017a:The matlab IDEExec=/usr/local/MATLAB/R2017a/bin/matlab -desktopIcon=/usr/local/MATLAB/R2017a/toolbox/nnet/nnresource/icons/matlab.pngTerminal=matlabCategories=MATLAB;

此时就可以通过所有应用程序打开 MATLAB 软件。

参考文献 在Linux环境(Ubuntu16.04)下安装Matlab2017a_VJONE_UCAS_BUPT的博客-CSDN博客_matlab在linux安装


【本文地址】


今日新闻


    推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3